<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>state</title>
  </head>
  <div id="app"></div>

  <body>
    <script src="../../public/js/react.development.js"></script>
    <script src="../../public/js/react-dom.development.js"></script>
    <script src="../../public/js/babel.min.js"></script>
    <script type="text/babel">
      class Person extends React.Component {
        constructor(props) {
          super(props);
          this.state = {
            name: "MING",
          };
					this.ChangeName = this.ChangeName.bind(this)
        }
        render() {
          const { name } = this.state;
          return <div onClick={this.ChangeName}>{name}</div>;
        }
        ChangeName() {
          this.setState({
						name:"UZI"
					});
        }
      }

      ReactDOM.render(<Person/>, document.getElementById("app"));
    </script>
  </body>
</html>
